<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="css/nav.css"/>
  
    <title>or导航</title>
    

  
</head>
<style>
    
</style>
<body>
    <div class="web_nav">
            <div class="nav_box">
                    <label for="left_nav">
                            <img src="images/close.png">
                    </label>
                    <ul class="ui">
                        <li><img src="images/xinlang2.png"></li>
                        <li><img src="images/wechat2.png"></li>
                        <li><img src="images/baidu2.png"></li>
                        <li><img src="images/xiangji2.png"></li>
                    </ul>
                    <ul class="daohang">
                            <a href="about.html">About Or</a>
                            <a href="canpin.html">Product</a>
                            <a href="admin.html">Space Inspiration</a>
                            <a href="huodong.html">User Experience</a>
                    </ul>
                    <ul class="line_content">
                            <li class="one">news</li>
                            <li class="two">event</li>
                            <li class="three">contact</li>
                    </ul>
            </div>
    </div>
</body>
<script>
  
    /*动态改变根元素字体大小*/
    function recalc() {
        var clientWidth = document.documentElement.clientWidth;
        if(!clientWidth) return;
        document.documentElement.style.fontSize = 40 * (clientWidth / 1920) + 'px';
    }
    
    function initRecalc() {
        recalc();
        var resizeEvt = 'osrientationchange' in window ? 'orientationchange' : 'resize';
        if(!document.addEventListener) return;
        window.addEventListener(resizeEvt, recalc, false);
        document.addEventListener('DOMContentLoaded', recalc, false);
    }
    initRecalc();
    
     console.log("手机viewportWidth=",document.documentElement.clientWidth);
        //获取viewport宽
        var viewportWidth = document.documentElement.clientWidth;
        console.log(document.documentElement.style.fontSize);
    </script>
  
    
</html>